home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_5796.txt < prev    next >
Text File  |  1989-02-26  |  3KB  |  149 lines

  1. -- card: 5796 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 2612
  5. -- name: ModResCopy
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=82 top=302 right=324 bottom=182
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Install
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if the optionkey is down then
  23.     pass mouseup
  24.   end if
  25.  
  26.   put (long name of this stack) into sourceStack
  27.   delete first word of sourceStack
  28.   delete first character of sourceStack
  29.   delete last character of sourceStack
  30.   put "Select a stack to copy this resource into."
  31.   put filename("STAK") into fname
  32.   if fname is empty then
  33.     hide message window
  34.     exit mouseup
  35.   end if
  36.   if sourcestack=fname then
  37.     beep
  38.     Answer "Get real.  You can't install it in this stack"
  39.     hide message window
  40.     exit mouseup
  41.   end if
  42.  
  43.   --
  44.   ModResCopy sourceStack,fname,"XCMD","ModResCopy"
  45.   --
  46.   get the result
  47.   if first char of it is "E" then
  48.     put it into the message box
  49.     beep
  50.     answer "Attempt to install resource has failed."
  51.   else
  52.     beep
  53.     answer "Resource installation successful"
  54.   end if
  55.   hide message window
  56. end mouseUp
  57.  
  58.  
  59.  
  60. -- part 2 (button)
  61. -- low flags: 00
  62. -- high flags: A004
  63. -- rect: left=223 top=243 right=293 bottom=282
  64. -- title width / last selected line: 0
  65. -- icon id / first selected line: 27056 / 27056
  66. -- text alignment: 1
  67. -- font id: 0
  68. -- text size: 12
  69. -- style flags: 0
  70. -- line height: 16
  71. -- part name: Try It
  72. ----- HyperTalk script -----
  73. on mouseUp
  74.   if the optionkey is down then
  75.     pass mouseup
  76.   end if
  77.  
  78.   put "Please select the source stack"
  79.   set cursor to 4
  80.   put filename("STAK") into source
  81.   if source is empty then
  82.     hide message window
  83.     exit mouseUp
  84.   end if
  85.  
  86.   ask "What is the resource type?"
  87.   if it is empty then
  88.     hide message window
  89.     exit mouseup
  90.   end if
  91.   put quote&it"e into ResType
  92.  
  93.   ask "What is the resource name?"
  94.   if it is empty then
  95.     hide message window
  96.     exit mouseup
  97.   end if
  98.   put quote&it"e into ResName
  99.  
  100.   put "Please select a destination stack"
  101.   put filename("STAK") into destination
  102.   if destination is empty then
  103.     hide message window
  104.     exit mouseUp
  105.   end if
  106.  
  107.   ModResCopy source,destination,ResType,ResName
  108.  
  109. end mouseUp
  110.  
  111.  
  112.  
  113. -- part contents for background part 2
  114. ----- text -----
  115. ModResCopy
  116.  
  117. -- part contents for background part 13
  118. ----- text -----
  119. 4
  120.  
  121. -- part contents for background part 3
  122. ----- text -----
  123.  
  124. This will copy a resource from one file into another file.
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. Thanks to:
  132. ? (If anyone knows who wrote this please pass the information on so proper credit can be given.)
  133.  
  134.  
  135. -- part contents for background part 10
  136. ----- text -----
  137. Syntax:
  138.  
  139. ModResCopy <sourceFile>,
  140. <destinationFile>,"ResourceType",
  141. "ResourceName"
  142.  
  143. <sourceFile> is the name of the file the resource will be copied from.
  144. <destinationFile> is the name of the file the resource will be copied to.
  145. "ResourceType" is the 'type' identification of the resource.
  146. "ResourceName" is (suprise) the name of the resource to be copied.  
  147.  
  148. If "Error" is returned to the result, then there was a problem copying the resource.
  149.